﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Collections;

namespace iResume
{
    public partial class SearchJobseeker : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            jobSeekerGrid.Visible = true;
            string email = (string)(Session["username"]);
            if (email == null)
            {
                Response.Redirect("loginpage.aspx");
            }
        }

        protected void SqlDataSource1_Selecting(object sender, SqlDataSourceSelectingEventArgs e)
        {

        }


        protected void jobSeekerGrid_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            if (e.CommandName == "Select")
            {
                // Convert the row index stored in the CommandArgument
                // property to an Integer.
                int index = Convert.ToInt32(e.CommandArgument);

                // Retrieve the row that contains the button clicked 
                // by the user from the Rows collection.
                GridViewRow row = jobSeekerGrid.Rows[index];

                // Create a new ListItem object for the contact in the row.     
                ListItem item = new ListItem();
                item.Text = Server.HtmlDecode(row.Cells[0].Text) + " " + Server.HtmlDecode(row.Cells[1].Text) + " " + Server.HtmlDecode(row.Cells[2].Text) + " " +
                Server.HtmlDecode(row.Cells[3].Text) + Server.HtmlDecode(row.Cells[4].Text) + " " + Server.HtmlDecode(row.Cells[5].Text) + " " + Server.HtmlDecode(row.Cells[6].Text) + " " + Server.HtmlDecode(row.Cells[7].Text) + " ";
                Session["fullName"] = row.Cells[1].Text;
                Session["jsusername"] = row.Cells[2].Text;
                Session["category"] = row.Cells[3].Text;
                Session["profile"] = row.Cells[4].Text;
                Session["education"] = row.Cells[5].Text;
                Session["Skills"] = row.Cells[6].Text;
                Session["workexperience"] = row.Cells[7].Text;
                Response.Redirect("recruiterViewJobSeeker.aspx");
            }
        }

        protected void ImageButton2_Click(object sender, ImageClickEventArgs e)
        {
            jobSeekerGrid.Visible = true;
        }
        
       
    }
}